<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>数据结构</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="spl.constants.html">« 预定义常量</a></li>
      <li style="float: right;"><a href="class.spldoublylinkedlist.html">SplDoublyLinkedList »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.spl.html">SPL</a></li>
    <li>数据结构</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="spl.datastructures" class="part">

 <h1>数据结构</h1>
<h2>目录</h2><ul class="chunklist chunklist_part"><li><a href="class.spldoublylinkedlist.html">SplDoublyLinkedList</a></li><li><a href="class.splstack.html">SplStack</a></li><li><a href="class.splqueue.html">SplQueue</a></li><li><a href="class.splheap.html">SplHeap</a></li><li><a href="class.splmaxheap.html">SplMaxHeap</a></li><li><a href="class.splminheap.html">SplMinHeap</a></li><li><a href="class.splpriorityqueue.html">SplPriorityQueue</a></li><li><a href="class.splfixedarray.html">SplFixedArray</a></li><li><a href="class.splobjectstorage.html">SplObjectStorage</a></li></ul>


 <div class="partintro">
  <p class="para">
   SPL 提供了一套标准的数据结构。它们按底层实现进行分组, 通常定义了它们的一般应用领域。
  </p>

  <div class="section">
   <h2 class="title">双向链表</h2>

   <p class="para">
    双链表 (DLL) 是一个链接到两个方向的节点列表。当底层结构是 DLL 时, 迭代器的操作、对两端的访问、节点的添加或删除都具有 O (1) 的开销。因此, 它为栈和队列提供了一个合适的实现。
   </p>

   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara"><span class="classname"><a href="class.spldoublylinkedlist.html" class="classname">SplDoublyLinkedList</a></span></span>
     <ul class="itemizedlist">
      <li class="listitem"><span class="simpara"><span class="classname"><a href="class.splstack.html" class="classname">SplStack</a></span></span></li>
      <li class="listitem"><span class="simpara"><span class="classname"><a href="class.splqueue.html" class="classname">SplQueue</a></span></span></li>
     </ul>
    </li>
   </ul>

  </div>
  <div class="section">
   <h2 class="title">堆</h2>

   <p class="para">
    堆是遵循堆属性的树状结构: 每个节点都大于或等于其子级, 使用对堆全局的已实现的比较方法进行比较。
   </p>

   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara"><span class="classname"><a href="class.splheap.html" class="classname">SplHeap</a></span></span>
     <ul class="itemizedlist">
      <li class="listitem"><span class="simpara"><span class="classname"><a href="class.splmaxheap.html" class="classname">SplMaxHeap</a></span></span></li>
      <li class="listitem"><span class="simpara"><span class="classname"><a href="class.splminheap.html" class="classname">SplMinHeap</a></span></span></li>
     </ul>
    </li>
    <li class="listitem">
     <span class="simpara"><span class="classname"><a href="class.splpriorityqueue.html" class="classname">SplPriorityQueue</a></span></span>
    </li>
   </ul>

  </div>

  <div class="section">
   <h2 class="title">数组</h2>

   <p class="para">
    数组是以连续方式存储数据的结构, 可通过索引进行访问。不要将它们与 php 数组混淆: php 数组实际上是按照有序的列表实现的。
   </p>

   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara"><span class="classname"><a href="class.splfixedarray.html" class="classname">SplFixedArray</a></span></span>
    </li>
   </ul>

  </div>

  <div class="section">
   <h2 class="title">映射</h2>

   <p class="para">
    映射是一个数据拥有键值对。PHP 数组可以被看作是从整数/字符串到值的映射。SPL 提供了从对象到数据的映射。此映射也可用作对象集。
   </p>

   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara"><span class="classname"><a href="class.splobjectstorage.html" class="classname">SplObjectStorage</a></span></span>
    </li>
   </ul>

  </div>
 </div>

 




 




 



 




 




 




 




 




 





 




 





</div>
</div></div></body></html>